﻿<Page
    x:Class="Antares.VIEWs.LogPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Antares.VIEWs"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Page.Transitions>
        <TransitionCollection>
            <EntranceThemeTransition/>
        </TransitionCollection>
    </Page.Transitions>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="120"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="120"/>
        </Grid.RowDefinitions>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1.2*"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="1.2*"/>
        </Grid.ColumnDefinitions>

        <Rectangle Grid.Row="1" Grid.ColumnSpan="3" Fill="Black" Opacity="0.3"/>
        <Grid Grid.Column="1" Background="{StaticResource ApplicationPageBackgroundThemeBrush}" Margin="0,20,0,20" Grid.Row="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
            <Grid.Resources>
                <Style x:Key="CommonTextStyle" TargetType="TextBlock">
                    <Setter Property="FontFamily" Value="Segoe UI"/>
                    <Setter Property="FontSize" Value="20"/>
                    <Setter Property="Foreground" Value="#FF383838"/>
                    <Setter Property="FontWeight" Value="ExtraLight"/>
                </Style>
                <Style x:Key="CommonTitleStyle" TargetType="TextBlock">
                    <Setter Property="FontFamily" Value="Segoe UI"/>
                    <Setter Property="FontSize" Value="13"/>
                    <Setter Property="Foreground" Value="#888888"/>
                    <Setter Property="FontWeight" Value="ExtraLight"/>
                </Style>
            </Grid.Resources>

            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="35"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="30"/>
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="40"/>
                <RowDefinition Height="60"/>
                <RowDefinition Height="30"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="10"/>
            </Grid.RowDefinitions>
            <Rectangle Fill="#3c81ba" Grid.Column="0" Width="4" HorizontalAlignment="Left" Grid.Row="1"/>
            <TextBlock Margin="9,0,0,0" Grid.Column="1" Grid.Row="1" Text="Task log" Style="{StaticResource CommonTextStyle}" FontSize="45" Foreground="#b4b4b4" FontWeight="SemiLight"/>

            <StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="2" VerticalAlignment="Bottom">
                <TextBlock Text="DATE"  Width="160" Margin="14,0,5,0" Style="{StaticResource CommonTitleStyle}" Foreground="#b4b4b4" FontWeight="SemiLight" />
                <TextBlock Text="ACTION" Width="100" Margin="0,0,5,0" Style="{StaticResource CommonTitleStyle}" Foreground="#b4b4b4" FontWeight="SemiLight" />
                <TextBlock Text="USERNAME" Margin="0,0,5,0" Style="{StaticResource CommonTitleStyle}" Foreground="#b4b4b4" FontWeight="SemiLight" />
            </StackPanel>

            <ListView ItemsSource="{Binding ListItems}" IsTabStop="False" BorderThickness="0" x:Name="LogGrid" SelectionMode="None" Grid.Column="1" Grid.Row="3" VerticalAlignment="Top" HorizontalAlignment="Left" >
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Width="{Binding ActualWidth, ElementName=LogGrid}" Orientation="Horizontal">
                            <Rectangle Fill="Green" Width="4" HorizontalAlignment="Left" Margin="0,0,4,0"/>
                            <TextBlock Style="{StaticResource CommonTextStyle}" FontSize="16" Margin="0,0,5,0" Width="160" TextTrimming="WordEllipsis" Text="{Binding DateTaken}"/>
                            <TextBlock Style="{StaticResource CommonTextStyle}" FontSize="16" Margin="0,0,5,0" Width="100" TextTrimming="WordEllipsis" Text="{Binding Action}"/>
                            <TextBlock Style="{StaticResource CommonTextStyle}" FontSize="16" Margin="0,0,5,0" TextTrimming="WordEllipsis" Text="{Binding Username}"/>
                        </StackPanel>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
            
            <Button TabIndex="0" Grid.Column="1" Grid.Row="4" VerticalAlignment="Center" HorizontalAlignment="Center" x:Name="cancelButton" Style="{StaticResource CancelTaskAppBarButtonStyle}"
                        Visibility="Visible"  
                         Tapped="cancelButton_Tapped_1"
                        AutomationProperties.Name="Cancel"/>
        </Grid>
    </Grid>
</Page>